Spaces:
Paused
Paused
Download node_modules/browserify-aes/modes/ofb.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 415 Bytes
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/browserify-aes/modes/ofb.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/browserify-aes/modes/ofb.js
-
curl -L -o ofb.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/browserify-aes/modes/ofb.js
415 Bytes
| var xor = require('buffer-xor') | |
| function getBlock (self) { | |
| self._prev = self._cipher.encryptBlock(self._prev) | |
| return self._prev | |
| } | |
| exports.encrypt = function (self, chunk) { | |
| while (self._cache.length < chunk.length) { | |
| self._cache = Buffer.concat([self._cache, getBlock(self)]) | |
| } | |
| var pad = self._cache.slice(0, chunk.length) | |
| self._cache = self._cache.slice(chunk.length) | |
| return xor(chunk, pad) | |
| } | |