UHasher constructor
UHasher(
- UHashAlgorithm algorithm
Implementation
UHasher(this.algorithm) : _state = Uint32List(algorithm == UHashAlgorithm.sha256 ? 8 : (algorithm == UHashAlgorithm.sha1 ? 5 : 4)) {
switch (algorithm) {
case UHashAlgorithm.md5:
_state.setAll(0, <int>[0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]);
case UHashAlgorithm.sha1:
_state.setAll(0, <int>[0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
case UHashAlgorithm.sha256:
_state.setAll(0, <int>[0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]);
}
}