How to use the js-sha256 function in js-sha256

To help you get started, we’ve selected a few js-sha256 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RocketChat / Rocket.Chat.ReactNative / app / views / ProfileView / index.js View on Github external
params.username = username;
		}

		// Email
		if (user.emails && user.emails[0].address !== email) {
			params.email = email;
		}

		// newPassword
		if (newPassword) {
			params.newPassword = newPassword;
		}

		// currentPassword
		if (currentPassword) {
			params.currentPassword = SHA256(currentPassword);
		}

		const requirePassword = !!params.email || newPassword;
		if (requirePassword && !params.currentPassword) {
			return this.setState({ showPasswordAlert: true, saving: false });
		}

		try {
			if (avatar.url) {
				try {
					await RocketChat.setAvatarFromService(avatar);
				} catch (e) {
					this.setState({ saving: false, currentPassword: null });
					return this.handleError(e, 'setAvatarFromService', 'changing_avatar');
				}
			}
github MartinLabs / generator-martinlabs / generators / app / templates / Login.vue View on Github external
login() {
        this.$resources.login.save({
          account: this.account,
          password: sha256(this.password),
        }).then((resp) => {
          simpleStorage.set('token<%= modulenameUpper %>', resp.body.token);
          simpleStorage.set('id<%= modulenameUpper %>', resp.body.id);

          const beforeLoginIntention = simpleStorage.get('beforeLoginIntention') || null;
          if (beforeLoginIntention) {
            simpleStorage.deleteKey('beforeLoginIntention');
            location.href = beforeLoginIntention;
          } else {
            this.$router.push('/home');
          }
        });
      },
    },
github LiskHQ / lisk-desktop / src / components / accountVisual / index.js View on Github external
const getHashChunks = (address) => {
  const addressHash = new BigNumber(`0x${sha256(address)}`).toString().substr(3);
  return addressHash.match(/\d{5}/g);
};
github bitshares / bitshares-ui / web / app / components / Account / Identicon.jsx View on Github external
render() {
      let {account} = this.props;
      let {height, width} = this.props.size;
      let hash = account ? sha256(account) : null;
      return (
           <canvas data-jdenticon-hash="{hash}" height="{height" width="{width" style="{{height:" id="{this.canvas_id}">
      );
  }
</canvas>
github bitshares / bitshares-ui / app / components / Account / Identicon.jsx View on Github external
render() {
        let {account} = this.props;
        let {height, width} = this.props.size;
        let hash = account ? sha256(account) : null;
        return (
            <canvas data-jdenticon-hash="{hash}" height="{height" width="{width" style="{{height:" id="{this.canvas_id}">
        );
    }
</canvas>
github netlify / netlify-cms / packages / netlify-cms-lib-util / src / getBlobSHA.ts View on Github external
    fr.onload = ({ target }) => resolve(sha256(target?.result));
    fr.onerror = err => {
github gxchain / gxchain-wallet / src / components / sub / AccountImage.vue View on Github external
hash: function () {
                return this.account ? sha256(this.account) : '';
            }
        },