example param { Buffer } a param { Buffer } b param { Boolean } isLooping return { Buffer } export default ( a , b , isLooping = false ) : Buffer => { const length = isLooping ? b . length : a . length ; const result = Buffer . alloc ( length ) ; for ( let i = 0 ; i < length ; i ++ ) { const j = isLooping ? i % a . length : i ; result [ i ] = a [ j ] ^ b [ i ] ; } return result ; } ;