{"id":20321371,"url":"https://github.com/retirejs/js-dev-console-fu","last_synced_at":"2025-08-18T07:15:21.280Z","repository":{"id":66296192,"uuid":"45925301","full_name":"RetireJS/js-dev-console-fu","owner":"RetireJS","description":null,"archived":false,"fork":false,"pushed_at":"2016-05-19T10:56:50.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T09:43:46.922Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RetireJS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-10T16:37:10.000Z","updated_at":"2017-03-28T06:59:02.000Z","dependencies_parsed_at":"2024-03-30T23:01:46.938Z","dependency_job_id":null,"html_url":"https://github.com/RetireJS/js-dev-console-fu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RetireJS/js-dev-console-fu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetireJS%2Fjs-dev-console-fu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetireJS%2Fjs-dev-console-fu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetireJS%2Fjs-dev-console-fu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetireJS%2Fjs-dev-console-fu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RetireJS","download_url":"https://codeload.github.com/RetireJS/js-dev-console-fu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetireJS%2Fjs-dev-console-fu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270957837,"owners_count":24675250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T19:14:44.455Z","updated_at":"2025-08-18T07:15:21.240Z","avatar_url":"https://github.com/RetireJS.png","language":"JavaScript","readme":"### Base64\nBrowser:\n\n    String.prototype.base64Decode = function() { return atob(this) }\n    String.prototype.base64Encode = function() { return btoa(this) }\n\nNode.js\n\n    Array.prototype.base64Encode = function() { return new Buffer(this.slice()).toString('base64'); }\n    String.prototype.base64Decode = function() { return Array.prototype.slice.apply(new Buffer(this.toString(), 'base64')); }\n\n### Hex encoding \n\n    String.prototype.hexDecode = function() { return this.match(/../g).map(function(c) { return parseInt(c, 16) }) }\n    String.prototype.hexEncode = function() { return this.toByteArray().hexEncode() }\n    Number.prototype.toHex = function() { return (\"0\" + this.toString(16)).substr(-2) }\n    Array.prototype.hexEncode = function() { return this.map(function(x) { return x.toHex() }).join(\"\") }\n\n### Ascii string vs byte array\n\n    String.prototype.toByte = function() { return this.charCodeAt(0) }\n    Number.prototype.toChar = function() { return String.fromCharCode(this) }\n    String.prototype.toByteArray = function() { return this.split('').map(function(c){ return c.toByte() }) }\n    Array.prototype.asString = function() { return String.fromCharCode.apply(null, this) }\n\n### Xor and random bytes\n\n    Array.prototype.xor = function(ar) { return this.map(function(e, i) { return e ^ ar[i % ar.length]; }) }\n    Array.randomBytes = function(length) { return Array.prototype.slice.call(crypto.getRandomValues(new Uint8Array(length))) }\n\n### Testing for insecure direct object references with jQuery\n\n    var exists= []; for(var i = 0; i \u003c 100 ; i++) (function(x) { $.getJSON(\"/?id=\" + x).success(function() { e.push(x) }) })(i);\n\n## Examples\nXOR plain text with random key\n\n    var key = Array.randomBytes(16);\n    var cipher = \"Hello world\".toByteArray().xor(key).hexEncode();\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretirejs%2Fjs-dev-console-fu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretirejs%2Fjs-dev-console-fu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretirejs%2Fjs-dev-console-fu/lists"}