├── .eslintrc ├── .gitignore ├── .snyk ├── .editorconfig ├── appveyor.yml ├── instructions.js ├── CHANGELOG.md ├── providers └── HashidsProvider.js ├── src └── Hashids │ ├── proxyHandler.js │ └── index.js ├── sonar-project.properties ├── CREDITS.md ├── LICENSE.md ├── bin └── index.js ├── example └── hashids.js ├── test └── hashids.spec.js ├── package.json ├── instructions.md ├── .travis.yml └── README.md /.eslintrc: -------------------------------------------------------------------------------- 1 | {"extends": ["standard"]} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | .nyc_output 3 | node_modules 4 | npm-debug.log 5 | .DS_Store 6 | .idea 7 | .scannerwork 8 | -------------------------------------------------------------------------------- /.snyk: -------------------------------------------------------------------------------- 1 | # Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. 2 | version: v1.7.1 3 | ignore: {} 4 | patch: {} 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_size = 2 6 | indent_style = space 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | matrix: 3 | - nodejs_version: 'Stable' 4 | - nodejs_version: '10' 5 | 6 | init: 7 | git config --global core.autocrlf true 8 | 9 | install: 10 | # Get the required Node version 11 | - ps: Install-Product node $env:nodejs_version 12 | - npm install 13 | 14 | test_script: 15 | - node --version 16 | - npm --version 17 | - npm run test:win 18 | 19 | build: off 20 | clone_depth: 1 21 | 22 | matrix: 23 | fast_finish: true 24 | -------------------------------------------------------------------------------- /instructions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /** 4 | * adonis-hashids 5 | * 6 | * (c) Carlson Orozco 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | const path = require('path') 13 | 14 | module.exports = async function (cli) { 15 | try { 16 | await cli.copy( 17 | path.join(__dirname, './example/hashids.js'), 18 | path.join(cli.helpers.configPath(), 'hashids.js') 19 | ) 20 | cli.command.completed('create', 'config/hashids.js') 21 | } catch (error) { 22 | // ignore error 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # adonis-hashids Changelog 2 | 3 | ## 1.0.5 4 | - Update packages 5 | 6 | ## 1.0.4 7 | - Update packages 8 | - Add FOSSA 9 | 10 | ## 1.0.3 11 | - Update packages 12 | 13 | ## 1.0.2 14 | - Update packages 15 | 16 | ## 1.0.1 17 | - Fix SonarQube settings 18 | - Fix Coveralls 19 | - Add Synk 20 | - Add Appveyor 21 | 22 | ## 1.0.0 23 | - Support AdonisJS 4.0 24 | - Add some tests 25 | 26 | ## 0.0.6 27 | - Add SonarQube 28 | 29 | ## 0.0.5 30 | - Update Dev Dependencies and Linting 31 | 32 | ## 0.0.4 33 | - Update vendor library 34 | 35 | ## 0.0.3 36 | - Update readme file add hashid.js link 37 | 38 | ## 0.0.2 39 | - Bug fix missing CommandsProvider 40 | 41 | ## 0.0.1 42 | - Initial release. 43 | -------------------------------------------------------------------------------- /providers/HashidsProvider.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /** 4 | * adonis-hashids 5 | * 6 | * (c) Carlson Orozco 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | const { ServiceProvider } = require('@adonisjs/fold') 13 | 14 | class HashidsProvider extends ServiceProvider { 15 | /** 16 | * Register all the required providers 17 | * 18 | * @method register 19 | * 20 | * @return {void} 21 | */ 22 | register () { 23 | this.app.singleton('Adonis/Addons/Hashids', app => { 24 | const Config = app.use('Adonis/Src/Config') 25 | const Hashids = require('../src/Hashids') 26 | return new Hashids(Config) 27 | }) 28 | this.app.alias('Adonis/Addons/Hashids', 'Hashids') 29 | } 30 | } 31 | 32 | module.exports = HashidsProvider 33 | -------------------------------------------------------------------------------- /src/Hashids/proxyHandler.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /** 4 | * adonis-hashids 5 | * 6 | * (c) Carlson Orozco 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | const proxyHandler = exports = module.exports = {} 13 | 14 | /** 15 | * proxies the target attributes and returns defined implementation 16 | * for them 17 | * 18 | * @param {Object} target 19 | * @param {String} name 20 | * 21 | * @return {Mixed} 22 | * @public 23 | */ 24 | proxyHandler.get = (target, name) => { 25 | /** 26 | * Node.js inspecting target 27 | */ 28 | if (typeof (name) === 'symbol' || name === 'inspect') { 29 | return target[name] 30 | } 31 | 32 | /** 33 | * Property exists on target 34 | */ 35 | if (typeof (target[name]) !== 'undefined') { 36 | return target[name] 37 | } 38 | 39 | return target.connection()[name] 40 | } 41 | -------------------------------------------------------------------------------- /sonar-project.properties: -------------------------------------------------------------------------------- 1 | sonar.projectKey=adonis-hashids 2 | sonar.projectName=Hashids Provider for AdonisJs framework. 3 | sonar.projectVersion=1.0.5 4 | 5 | # ===================================================== 6 | # Meta-data for the project 7 | # ===================================================== 8 | 9 | sonar.links.homepage=https://github.com/carlsonorozco/adonis-hashids 10 | sonar.links.ci=https://travis-ci.org/carlsonorozco/adonis-hashids 11 | sonar.links.scm=https://github.com/carlsonorozco/adonis-hashids 12 | sonar.links.issue=https://github.com/carlsonorozco/adonis-hashids/issues 13 | 14 | # ===================================================== 15 | # Properties that will be shared amongst all modules 16 | # ===================================================== 17 | 18 | # SQ standard properties 19 | sonar.organization=carlsonorozco-github 20 | sonar.sources=src 21 | sonar.tests=test 22 | 23 | # Properties specific to language plugins: 24 | # - For JavaScript 25 | sonar.javascript.lcov.reportPaths=coverage/lcov.info 26 | -------------------------------------------------------------------------------- /CREDITS.md: -------------------------------------------------------------------------------- 1 | ### Adonis Framework 2 | --- 3 | The MIT License (MIT) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2019 Carlson Orozco 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /bin/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /* 4 | * adonis-framework 5 | * 6 | * (c) Harminder Virk 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | const semver = require('semver') 13 | const { spawn } = require('child_process') 14 | const spawnArgs = [] 15 | 16 | if (semver.lt(process.version, '8.0.0')) { 17 | spawnArgs.push('--harmony-async-await') 18 | } 19 | 20 | function local () { 21 | spawnArgs.push('./node_modules/.bin/japa') 22 | const tests = spawn('node', spawnArgs) 23 | tests.stdout.on('data', (data) => process.stdout.write(data)) 24 | tests.stderr.on('data', (data) => process.stderr.write(data)) 25 | tests.on('close', (code) => process.exit(code)) 26 | } 27 | 28 | function win () { 29 | spawnArgs.push('./node_modules/japa-cli/index.js') 30 | const tests = spawn('node', spawnArgs) 31 | tests.stdout.on('data', (data) => process.stdout.write(data)) 32 | tests.stderr.on('data', (data) => process.stderr.write(data)) 33 | tests.on('close', (code) => process.exit(code)) 34 | } 35 | 36 | if (process.argv.indexOf('--local') > -1) { 37 | local() 38 | } else if (process.argv.indexOf('--win') > -1) { 39 | win() 40 | } 41 | -------------------------------------------------------------------------------- /src/Hashids/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /** 4 | * adonis-hashids 5 | * 6 | * (c) Carlson Orozco 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | const GE = require('@adonisjs/generic-exceptions') 13 | const HashidsInstance = require('hashids') 14 | const proxyHandler = require('./proxyHandler') 15 | 16 | /** 17 | * Hashids class 18 | * 19 | * @namespace Adonis/Addons/Hashids 20 | * @singleton 21 | * @alias Hashids 22 | * 23 | * @class Hashids 24 | * @constructor 25 | */ 26 | class Hashids { 27 | constructor (Config) { 28 | this.Config = Config 29 | return new Proxy(this, proxyHandler) 30 | } 31 | 32 | /** 33 | * returns instance of a new factory instance for 34 | * a given connection 35 | * 36 | * @param {String} [connection=''] 37 | * 38 | * @return {Object} Instance of hashids 39 | * 40 | * @public 41 | */ 42 | connection (connection = '') { 43 | connection = connection || this.Config.get('hashids.connection') 44 | const config = this.Config.get(`hashids.${connection}`) 45 | 46 | if (!config) { 47 | throw GE.RuntimeException.missingConfig(connection || 'configuration for hashids', 'config/hashids.js') 48 | } 49 | 50 | return new HashidsInstance(config.salt, config.length, config.alphabet) 51 | } 52 | } 53 | 54 | module.exports = Hashids 55 | -------------------------------------------------------------------------------- /example/hashids.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Hashids Configuaration 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Here we define the configuration for hashids. A single application 9 | | can make use of multiple hashids connections using the hashids provider. 10 | | 11 | */ 12 | 13 | const Env = use('Env') 14 | 15 | module.exports = { 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Default Connection Name 20 | |-------------------------------------------------------------------------- 21 | | 22 | | Here you may specify which of the connections below you wish to use as 23 | | your default connection for all work. Of course, you may use many 24 | | connections at once. 25 | | 26 | */ 27 | 28 | connection: Env.get('HASHIDS_CONNECTION', 'default'), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Hashids Connections 33 | |-------------------------------------------------------------------------- 34 | | 35 | | Here are each of the connections setup for your application. Example 36 | | configuration has been included, but you may add as many connections as 37 | | you would like. 38 | | 39 | */ 40 | 41 | default: { 42 | salt: 'your-salt-string', 43 | length: 0, 44 | alphabet: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' 45 | }, 46 | 47 | alternative: { 48 | salt: 'your-salt-string', 49 | length: 'your-length-integer', 50 | alphabet: 'your-alphabet-string' 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /test/hashids.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /** 4 | * adonis-hashids 5 | * 6 | * (c) Carlson Orozco 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | const test = require('japa') 13 | const { Config } = require('@adonisjs/sink') 14 | const Hashids = require('../src/Hashids') 15 | const HashidsInstance = require('hashids') 16 | 17 | test.group('Hashids', group => { 18 | test('should throw exception when connection is not defined in hashids config file', assert => { 19 | const connection = new Hashids(new Config()) 20 | const fn = () => connection._getConfig() 21 | assert.throw(fn, 'E_MISSING_CONFIG: configuration for hashids is not defined inside config/hashids.js file') 22 | }) 23 | 24 | test('should return the instance of hashids when using connection method', assert => { 25 | const config = new Config() 26 | config.set('hashids', { 27 | connection: 'default', 28 | default: { salt: 'your-salt-string', length: 5, alphabet: 'abcdef1234567890' } 29 | }) 30 | const hashids = new Hashids(config) 31 | assert.equal(hashids.connection() instanceof HashidsInstance, true) 32 | }) 33 | 34 | test('should throw error when unable to find config for a given connection', assert => { 35 | const config = new Config() 36 | config.set('hashids', { 37 | connection: 'default', 38 | default: { salt: 'your-salt-string', length: 5, alphabet: 'abcdef1234567890' } 39 | }) 40 | const hashids = new Hashids(config) 41 | const fn = () => hashids.connection('foo') 42 | assert.throw(fn, 'E_MISSING_CONFIG: foo is not defined inside config/hashids.js file') 43 | }) 44 | }) 45 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "adonis-hashids", 3 | "version": "1.0.5", 4 | "description": "Hashids Provider for AdonisJs framework", 5 | "homepage": "https://github.com/carlsonorozco/adonis-hashids", 6 | "bugs": { 7 | "url": "https://github.com/carlsonorozco/adonis-hashids/issues" 8 | }, 9 | "license": "MIT", 10 | "author": "Carlson Orozco ", 11 | "scripts": { 12 | "lint": "standard", 13 | "pretest": "npm run lint", 14 | "posttest": "npm run coverage", 15 | "test:local": "FORCE_COLOR=true node bin/index.js --local", 16 | "test": "snyk test && nyc npm run test:local", 17 | "test:win": "set FORCE_COLOR=true && node bin/index.js --win", 18 | "coverage": "nyc report --reporter=lcov --reporter=text-lcov | coveralls" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "git+https://github.com/carlsonorozco/adonis-hashids.git" 23 | }, 24 | "devDependencies": { 25 | "@adonisjs/fold": "^4.0.9", 26 | "@adonisjs/sink": "^1.0.17", 27 | "coveralls": "^3.0.2", 28 | "cz-conventional-changelog": "^2.1.0", 29 | "japa": "^1.0.6", 30 | "japa-cli": "^1.0.1", 31 | "nyc": "^13.1.0", 32 | "snyk": "^1.118.2", 33 | "standard": "^12.0.1" 34 | }, 35 | "dependencies": { 36 | "@adonisjs/generic-exceptions": "^3.0.1", 37 | "hashids": "^1.2.2" 38 | }, 39 | "keywords": [ 40 | "adonisjs", 41 | "adonis", 42 | "adonis-framework", 43 | "hashids", 44 | "hash", 45 | "youtube", 46 | "bitly", 47 | "obfuscate", 48 | "encode", 49 | "decode", 50 | "encrypt", 51 | "decrypt" 52 | ], 53 | "standard": { 54 | "globals": [ 55 | "use" 56 | ] 57 | }, 58 | "nyc": { 59 | "exclude": [ 60 | "**/*.spec.js", 61 | "bin" 62 | ] 63 | }, 64 | "directories": { 65 | "test": "test" 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /instructions.md: -------------------------------------------------------------------------------- 1 | ## Registering provider 2 | 3 | Make sure you register the provider inside `start/app.js` file before making use hashids. 4 | 5 | ```js 6 | const providers = [ 7 | 'adonis-hashids/providers/HashidsProvider' 8 | ] 9 | ``` 10 | 11 | Once that done you can make use of Hashids anywhere by importing the Hashids provider. 12 | 13 | ## Usage 14 | 15 | ### Using default connection 16 | 17 | ```javascript 18 | // Initialize 19 | const Hashids = use('Hashids') 20 | 21 | Hashids.encode(1) 22 | // OY 23 | 24 | Hashids.decode('OY') 25 | // [ 1 ] 26 | ``` 27 | 28 | ### Combination of ids 29 | 30 | ```javascript 31 | // Initialize 32 | const Hashids = use('Hashids') 33 | 34 | Hashids.encode(1, 2, 3) 35 | // or Array 36 | Hashids.encode([1, 2, 3]) 37 | // will ouput wzs9cr 38 | 39 | Hashids.decode('wzs9cr') 40 | // [ 1, 2, 3 ] 41 | ``` 42 | 43 | ### Encode hex 44 | 45 | ```javascript 46 | // Initialize 47 | const Hashids = use('Hashids') 48 | 49 | Hashids.encodeHex('507f1f77bcf86cd799439011') 50 | // Nrao6rxKbziryRrXR1zD 51 | 52 | Hashids.decodeHex('Nrao6rxKbziryRrXR1zD') 53 | // 507f1f77bcf86cd799439011 54 | ``` 55 | 56 | ### Using other connection 57 | 58 | ```javascript 59 | // Initialize 60 | const Hashids = use('Hashids') 61 | 62 | Hashids.connection('alternative').encode(1) 63 | // OY 64 | 65 | Hashids.connection('alternative').decode('OY') 66 | // [ 1 ] 67 | ``` 68 | 69 | ## Configuration 70 | 71 | Adonis Hashids generate YouTube-like ids from numbers. Use Hashids when you do not want to expose your database ids to the user. The hashids configuration is located at `config/hashids.js`. In this file you may specify which hashids connection you would like used by default throughout your application. 72 | 73 | The hashids configuration file also contains various other options, which are documented within the file so make sure to read over these options. By default Adonis Hashids is configured to use the `default` connection. 74 | 75 | ## Environment variables 76 | The configuration file makes use of **Environment variables**, make sure to define them for development and in production too 77 | 78 | ``` 79 | HASHIDS_CONNECTION=default 80 | ``` 81 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | language: node_js 3 | node_js: 4 | - node 5 | install: 6 | - npm install 7 | addons: 8 | sonarcloud: 9 | organization: carlsonorozco-github 10 | token: 11 | secure: kAIYJPa0lEvF+KhwsYHvwxEmvEySlshmJP8QxeI8IzzW5ndULWG1sB2B81E/UZ8pgGyM1BlW3N2VV0A+F8QZmbRqiN3jQAz3DsWQHJTEEGxl0sjJeKJ3Vw1mtGqdkJ7tziHVsP4QO5zvLxrb0ul1xJ0QwxoaMbGp6ErY1dIJYttF01y4RtsyNAaQz3VHr3oyMT03oJTZNt9Pq8mTpo+60Kj+ydogtlfVZ/IeG5hKJ2hH0YNw3zxZ6mB5EXo45PAw5tf5d6YjWVyxHX71yuZ/H+6G9I77JEnMf0iN/c3zo+gxUL54SagmAaowoHK8NfwSKT/1JW9Akw+vUqcQs9TMWn+ZqjQ8RPPSHFkaPVxHPACJvVnh35E12VXqPXFYTombQRxKB0xHRpX2fOdUXvRl6C84s5u4YTWX7Mf8q6evEUevSUnlMnEyLdfMBjom3Q3zKZ1/ddg26CGORhEGTiNs/QLMXhb/65L0HULgCYYh4vcUC/G68yKs5blzi81yxntiHuAAKn8Hn5MFJqeHoTnzQvjnRdwQh+3WaSbxzuIhlKyJTqsp2KtV3c4jC8iSZ1axq4gPlVYSKAqjn4KGjAi2z7Jbb3W0h/op2QpYpFunGalGZFdI0NWlktBGvBAM7CopBYrbl/dCI9VRoXGyoj11cw/DlHPJM0JfdiMO5bOvfAw= 12 | github_token: 13 | secure: SxlrNXa+aoWBMraNUz7PVfo1u+Ha7kEPOIBMCKJknyqCqIaciRSnFIBFZApk+tun+5G5jNsL7g7xIsOm3/V5bePP2TMHMloMHBXAat/9SV1/9I+Lbn5B4pue43ghbbMWeeYHpd9rNan0dplgldSuJhNtLjfwcuGwIwqkvQl9ZWkrSbFT/GS6xJNBPZcO4ovFUQDyzAx7YbpR7q55zWlCpzLLWOllgzKqrqmePGfeAQ/5DMgfgaSSlSUS/TwvawSfEd1aY2ro4tdnBXXffEZU6+82S2fBSTiDKduHz6G/1dEBF8NTO3PdQjfi3TdnfxM4TkITanir7YEU9x29NpYhcOsUF2ndoDmqrUf7x+CedevoTGpXIoUKqeCr2uUXVG0w29c5IZITMwUVUSLVbibZ7yx7nKmsVa4ZRAii0uuch+tNAIEi3h4CohoS6mZGyu/M7mc5TfWG+pcdvNvCJYOdsT1fhNeLHKPv9zTKPgtKaFYeWsmeWkiqur3Tyc3TdH2hRMCph17Yj16674VP7f6GOzkxYoyb5TES0uMyEyf4YWw58j0GnUMJXUJ2yHbG5My3Hy+RN6wNHr3nBXcJ7OOu98ZHeSpSaXXCkFrNU8HK3fQESgcRrR3VO0zcCa1Q3O+FAAzpOG8OrVTYxnNw8v1SpnGIuBiUPn6fPeRPTMUD9+Y= 14 | branches: 15 | - master 16 | - develop 17 | script: 18 | - npm test 19 | - sonar-scanner 20 | cache: 21 | directories: 22 | - $HOME/.sonar/cache 23 | env: 24 | matrix: 25 | secure: qAAl9eDEMyGZ6qdZq61z3pHySzBO5D0zcI3hXoZe8suHYyv5cDo1rsdvl8mpH77BIJgm2+u8UTW39VDmHL7/ZoUVC6FypagzP/EOBoUuj3guE6dETmM7Py9Dr+goxh5H5vqhmQRz6LQCnJog5bw+oC6yxm/aBNnsnsuxod1znP0d7oKr9kNPfCj/wWLOp/86kpmisyFJt89PnTvqK07DN0JeEC3yJj0WessIQ2aZvUyCxj9dfiWXBmj9O+pQiZHpfAg2YzY01UMkpQ0/N0eVkUb93odkXwOSnXypj97s9AjMu6RUSWjhdhiVQ30AfusjlU6i1tuuKDfl/Z3eFBbPxLLrxbJ7Vga7arrWPqeas0yRm92fsT0oA1xF1QwECYbbpm/iwqd/NFW3Vbk4c4pcOIQihs+YJzAMhYYXb8UdFB0RbliDRgFnA5fRB5cxZIyogYpmE3OmfOo4dfvSImfkOZ5MGTazLuvJmVcimPXBdGILL7NemS5VVZG76brV/Ea5I9KdknZ5AB38zvtiz8EQpXiuVQarZjZRB5yshxGVoA3Lc8/X909Gi0k6xckAksFxjURI5PxN6cJ7i7zKtmRIjTl+Fbl2UssBq/VOLKJH8syAf9YAmMO3qy2rIa5Ff3GfmY51lWd0FY9AldLR4Zxi8m2RPWH96YJ4IOL7li61uZU= 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AdonisJS Hashids :hash: 2 | 3 | Adonis Hashids is a [Hashids](https://github.com/ivanakimov/hashids.js) Provider for AdonisJs framework. 4 | 5 | [![npm version](https://badge.fury.io/js/adonis-hashids.svg)](https://badge.fury.io/js/adonis-hashids) 6 | [![npm](https://img.shields.io/npm/dt/adonis-hashids.svg)](https://www.npmjs.com/package/adonis-hashids) 7 | [![Build Status](https://travis-ci.org/carlsonorozco/adonis-hashids.svg?branch=master)](https://travis-ci.org/carlsonorozco/adonis-hashids) 8 | [![Appveyor](https://img.shields.io/appveyor/ci/carlsonorozco/adonis-hashids/master.svg?style=flat-square)](https://ci.appveyor.com/project/carlsonorozco/adonis-hashids) 9 | [![Greenkeeper badge](https://badges.greenkeeper.io/carlsonorozco/adonis-hashids.svg)](https://greenkeeper.io/) 10 | [![Quality Gate](https://sonarqube.com/api/badges/gate?key=adonis-hashids)](https://sonarcloud.io/dashboard?id=adonis-hashids) 11 | [![Coverage Status](https://coveralls.io/repos/github/carlsonorozco/adonis-hashids/badge.svg?branch=master)](https://coveralls.io/github/carlsonorozco/adonis-hashids?branch=master) 12 | [![Known Vulnerabilities](https://snyk.io/test/github/carlsonorozco/adonis-hashids/badge.svg)](https://snyk.io/test/github/carlsonorozco/adonis-hashids) 13 | [![dependencies Status](https://david-dm.org/carlsonorozco/adonis-hashids/status.svg)](https://david-dm.org/carlsonorozco/adonis-hashids) 14 | [![devDependencies Status](https://david-dm.org/carlsonorozco/adonis-hashids/dev-status.svg)](https://david-dm.org/carlsonorozco/adonis-hashids?type=dev) 15 | [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) 16 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcarlsonorozco%2Fadonis-hashids.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fcarlsonorozco%2Fadonis-hashids?ref=badge_shield) 17 | 18 | 19 | 20 | ## Node/OS Target 21 | 22 | This repo/branch is supposed to run fine on all major OS platforms and targets `Node.js >=10.0` 23 | 24 | ## Installation 25 | 26 | In order to use adonis-hashids 27 | 28 | ``` 29 | adonis install adonis-hashids 30 | ``` 31 | 32 | ## Changelog 33 | 34 | [CHANGELOG](CHANGELOG.md) 35 | 36 | ## Credits 37 | 38 | Thanks to the community of [AdonisJs](http://www.adonisjs.com/). 39 | 40 | ## Copyright and License 41 | 42 | Copyright (c) 2016-2019 [Carlson Orozco](http://carlsonorozco.com/), [MIT](LICENSE.md) License 43 | 44 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcarlsonorozco%2Fadonis-hashids.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fcarlsonorozco%2Fadonis-hashids?ref=badge_large) 45 | --------------------------------------------------------------------------------