sha1 constant

Hash const sha1

SHA-1 as specified in FIPS PUB 180-4.

This algorithm is considered weak and should not be used in new cryptographic applications.

Example

import 'dart:convert' show base64, utf8;
import 'package:webcrypto/webcrypto.dart';

// Convert 'hello world' to a byte array
final bytesToHash = utf8.encode('hello world');

// Compute hash of bytesToHash with sha-256
List<int> hash = await Hash.sha256.digestBytes(bytesToHash);

// Print the base64 encoded hash
print(base64.encode(hash));

Implementation

static const Hash sha1 = impl.sha1;