tjwebb / fnv-plus

Javascript FNV-1a Hash Algorithm (up to 1024 bit) implementation. Based on:
http://tools.ietf.org/html/draft-eastlake-fnv-06
85 stars 13 forks source link

hash32 cannot handle Unicode #8

Closed max0x7ba closed 6 years ago

max0x7ba commented 8 years ago

FNV-1a works on octets.

In hash32 it does hash ^= str.charCodeAt(i); which does not do the right thing for Unicode, for example "Я".charCodeAt(0) is 1071.