/knowitwhenyouseeit

Provides functions to render client-side data but only if it matches a secure digest

Primary LanguageJavaScript

provides functions to render client-side data but only if it matches a secure digest

NPM JavaScript Style Guide

Install

yarn add knowitwhenyouseeit

Usage

import whitelisted from 'knowitwhenyouseeit'

const getMessage = whitelisted(
  "$2y$12$BcuZ0VfUeLLpoLxOC5Xv7eQQK0r95by8YJsECCldKP4ftPr20rpXW", //hello world
  "$2y$12$hxyWxMx.qap70Snn1QKMwuDp/9XgNM7HpwbrGnsPu/j7dyTEWh0M2" //hewwo world
)

getMessage("helllo world!") // false
getMessage("hello world") // "hello world"

License

MIT © zemnmez