Created
February 6, 2017 17:25
-
-
Save joetannenbaum/88957fda88cbea543718cb5e43a8c4e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Hashids from 'hashids' | |
class HashIds { | |
evaluate() { | |
const hasher = new Hashids(this.salt, this.padding) | |
return hasher.encode(this.id) | |
} | |
} | |
HashIds.identifier = 'shop.sammich.HashIds' | |
HashIds.title = 'Hash IDs' | |
HashIds.inputs = [ | |
InputField('id', 'ID', 'Number'), | |
InputField('padding', 'Padding', 'Number', { | |
persist: true, | |
defaultValue: 10, | |
}), | |
InputField('salt', 'Salt', 'String', { | |
persist: true, | |
defaultValue: 'salty', | |
}), | |
] | |
registerDynamicValueClass(HashIds) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment