switch hashStr to use addBytes

This commit is contained in:
Brendan Hansknecht 2022-10-12 12:09:57 -07:00
parent 49c3fe1643
commit f398bb1eff
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -75,8 +75,7 @@ Hasher has
## Adds a string into a [Hasher] by hashing its UTF-8 bytes. ## Adds a string into a [Hasher] by hashing its UTF-8 bytes.
hashStrBytes = \hasher, s -> hashStrBytes = \hasher, s ->
Str.walkUtf8WithIndex s hasher \accumHasher, byte, _ -> addBytes hasher (Str.toUtf8 s)
addU8 accumHasher byte
## Adds a list of [Hash]able elements to a [Hasher] by hashing each element. ## Adds a list of [Hash]able elements to a [Hasher] by hashing each element.
hashList = \hasher, lst -> hashList = \hasher, lst ->