We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, secretlint-rule-{npm/github} does not check CRC32 in tokens.
we want to suport it.
// https://gist.github.com/kevinyan815/f71b2f5ca3541631abd2e50f3929739b function toBase62(n) { if (n === 0) { return '0'; } const digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; let result = ''; while (n > 0) { result = digits[n % digits.length] + result; n = parseInt(n / digits.length, 10); } return result; } //https://stackoverflow.com/a/18639999 const crc32 = function (str) { const makeCRCTable = function () { var c; var crcTable = []; for (var n = 0; n < 256; n++) { c = n; for (var k = 0; k < 8; k++) { c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); } crcTable[n] = c; } return crcTable; }; const crcTable = makeCRCTable(); let crc = 0 ^ (-1); for (let i = 0; i < str.length; i++) { crc = (crc >>> 8) ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xFF]; } return (crc ^ (-1)) >>> 0; }; console.log(toBase62(crc32("qkJaB6MffYVzZXWqmcoF49yrUxP3wf")).padStart(6, "0")); // "0LsakP"
Minimal implementation for CRC32.
Reference
Originally posted by @azu in #200 (comment)
The text was updated successfully, but these errors were encountered:
alexgorbatchev/crc: Blazingly fast CRC implementations for node.js and browser
Sorry, something went wrong.
No branches or pull requests
Currently, secretlint-rule-{npm/github} does not check CRC32 in tokens.
we want to suport it.
PoC
Minimal implementation for CRC32.
TODO
Reference
Originally posted by @azu in #200 (comment)
The text was updated successfully, but these errors were encountered: