@cicara/murmurhash
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,2 +0,2 @@ | ||
function g(n, a) { | ||
function g(n, a = 0) { | ||
typeof n == "string" && (n = new TextEncoder().encode(n)); | ||
@@ -3,0 +3,0 @@ let i = n.length, t = a ^ i, e = 0, h; |
@@ -1,1 +0,1 @@ | ||
(function(h,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(h=typeof globalThis<"u"?globalThis:h||self,l(h.Murmurhash={}))})(this,function(h){"use strict";function l(n,d){typeof n=="string"&&(n=new TextEncoder().encode(n));let o=n.length,c=d^o,e=0,i;for(;o>=4;)i=n[e]&255|(n[++e]&255)<<8|(n[++e]&255)<<16|(n[++e]&255)<<24,i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16),i^=i>>>24,i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16),c=(c&65535)*1540483477+(((c>>>16)*1540483477&65535)<<16)^i,o-=4,++e;switch(o){case 3:c^=(n[e+2]&255)<<16;case 2:c^=(n[e+1]&255)<<8;case 1:c^=n[e]&255,c=(c&65535)*1540483477+(((c>>>16)*1540483477&65535)<<16)}return c^=c>>>13,c=(c&65535)*1540483477+(((c>>>16)*1540483477&65535)<<16),c^=c>>>15,c>>>0}function a(n,d=0){typeof n=="string"&&(n=new TextEncoder().encode(n));const o=n.length&3,c=n.length-o;let e=d;const i=3432918353,f=461845907;let u=0,s,t;for(;u<c;)t=n[u]&255|(n[++u]&255)<<8|(n[++u]&255)<<16|(n[++u]&255)<<24,++u,t=(t&65535)*i+(((t>>>16)*i&65535)<<16)&4294967295,t=t<<15|t>>>17,t=(t&65535)*f+(((t>>>16)*f&65535)<<16)&4294967295,e^=t,e=e<<13|e>>>19,s=(e&65535)*5+(((e>>>16)*5&65535)<<16)&4294967295,e=(s&65535)+27492+(((s>>>16)+58964&65535)<<16);switch(t=0,o){case 3:t^=(n[u+2]&255)<<16;case 2:t^=(n[u+1]&255)<<8;case 1:t^=n[u]&255,t=(t&65535)*i+(((t>>>16)*i&65535)<<16)&4294967295,t=t<<15|t>>>17,t=(t&65535)*f+(((t>>>16)*f&65535)<<16)&4294967295,e^=t}return e^=n.length,e^=e>>>16,e=(e&65535)*2246822507+(((e>>>16)*2246822507&65535)<<16)&4294967295,e^=e>>>13,e=(e&65535)*3266489909+(((e>>>16)*3266489909&65535)<<16)&4294967295,e^=e>>>16,e>>>0}h.murmurhash2_32_gc=l,h.murmurhash3_32_gc=a,h.v2=l,h.v3=a,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}); | ||
(function(h,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(h=typeof globalThis<"u"?globalThis:h||self,l(h.Murmurhash={}))})(this,function(h){"use strict";function l(n,d=0){typeof n=="string"&&(n=new TextEncoder().encode(n));let o=n.length,c=d^o,e=0,i;for(;o>=4;)i=n[e]&255|(n[++e]&255)<<8|(n[++e]&255)<<16|(n[++e]&255)<<24,i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16),i^=i>>>24,i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16),c=(c&65535)*1540483477+(((c>>>16)*1540483477&65535)<<16)^i,o-=4,++e;switch(o){case 3:c^=(n[e+2]&255)<<16;case 2:c^=(n[e+1]&255)<<8;case 1:c^=n[e]&255,c=(c&65535)*1540483477+(((c>>>16)*1540483477&65535)<<16)}return c^=c>>>13,c=(c&65535)*1540483477+(((c>>>16)*1540483477&65535)<<16),c^=c>>>15,c>>>0}function a(n,d=0){typeof n=="string"&&(n=new TextEncoder().encode(n));const o=n.length&3,c=n.length-o;let e=d;const i=3432918353,f=461845907;let u=0,s,t;for(;u<c;)t=n[u]&255|(n[++u]&255)<<8|(n[++u]&255)<<16|(n[++u]&255)<<24,++u,t=(t&65535)*i+(((t>>>16)*i&65535)<<16)&4294967295,t=t<<15|t>>>17,t=(t&65535)*f+(((t>>>16)*f&65535)<<16)&4294967295,e^=t,e=e<<13|e>>>19,s=(e&65535)*5+(((e>>>16)*5&65535)<<16)&4294967295,e=(s&65535)+27492+(((s>>>16)+58964&65535)<<16);switch(t=0,o){case 3:t^=(n[u+2]&255)<<16;case 2:t^=(n[u+1]&255)<<8;case 1:t^=n[u]&255,t=(t&65535)*i+(((t>>>16)*i&65535)<<16)&4294967295,t=t<<15|t>>>17,t=(t&65535)*f+(((t>>>16)*f&65535)<<16)&4294967295,e^=t}return e^=n.length,e^=e>>>16,e=(e&65535)*2246822507+(((e>>>16)*2246822507&65535)<<16)&4294967295,e^=e>>>13,e=(e&65535)*3266489909+(((e>>>16)*3266489909&65535)<<16)&4294967295,e^=e>>>16,e>>>0}h.murmurhash2_32_gc=l,h.murmurhash3_32_gc=a,h.v2=l,h.v3=a,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}); |
@@ -13,2 +13,2 @@ /** | ||
*/ | ||
export declare function murmurhash2_32_gc(str: string | Uint8Array, seed: number): number; | ||
export declare function murmurhash2_32_gc(str: string | Uint8Array, seed?: number): number; |
{ | ||
"name": "@cicara/murmurhash", | ||
"type": "module", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "an optimized javascript implementation of the murmurhash algorithms", | ||
@@ -6,0 +6,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
8996