diff --git a/blake.js b/src/blake.js copy from blake.js copy to src/blake.js --- a/blake.js +++ b/src/blake.js @@ -12,7 +12,7 @@ function rrot(x,shift){ return ((x>>>shift)|(x<<(32-shift)))&MASK; } -function BLAKE2S(outputLen=32,key=[]){ +export function BLAKE2S(outputLen=32,key=[]){ this._buffer=[]; this._dataLen=[0,0]; // low, high this._outputLen=outputLen; @@ -85,25 +85,8 @@ BLAKE2S.prototype._mix=function(arr,ia,i arr[ia]=a; arr[ib]=b; arr[ic]=c; arr[id]=d; }; -function blake2s(data,outputLen=32,key=[]){ +export function blake2s(data,outputLen=32,key=[]){ let h=new BLAKE2S(outputLen,key); for(let i=0;i