You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constassert=require('assert')functionxor(data,key){assert(data.length<=key.length,'key length not equal/bigger data length')letout=Buffer.alloc(data.length)for(vari=0;i<data.length;i++){out[i]=data[i]^key[i]}returnout}
This improved version can encrypt buffers and use more than one-byte as encryption key
Uncaught ReferenceError: Buffer is not defined
at xorCrypt (xor-crypt.js:50)
at HTMLButtonElement.<anonymous> ((index):79)
xorCrypt @ xor-crypt.js:50
(anonymous) @ (index):79
Perhaps we could check if Buffer is available, and fallback to strings if not?
This improved version can encrypt buffers and use more than one-byte as encryption key
Example:
The text was updated successfully, but these errors were encountered: