Socket
Socket
Sign inDemoInstall

bitagora-booth

Package Overview
Dependencies
Maintainers
1
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitagora-booth - npm Package Compare versions

Comparing version 1.0.25 to 1.0.26

10

lib/functions.js
const {
BITAGORA_URL, BITAGORA_PREFIX, BITAGORA_FAMILY, BITAGORA_VERSION
} = require('./constants');
//const crypto = require('crypto');
const crypto = require('crypto');
const atob = require('atob');
const btoa = require('btoa');
//const cbor = require('cbor');
const cbor = require('cbor');
const _hash = (sha, x) => x;
//const _hash = (sha, x) => crypto.createHash(sha).update(x).digest('hex').toLowerCase();
const _hash = (sha, x) => crypto.createHash(sha).update(x).digest('hex').toLowerCase();
const _hexToB64 = (str) => btoa(String.fromCharCode.apply(null,str.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" ")));

@@ -162,4 +161,3 @@ const _B64ToHex = (str) => {

if (!Boolean(json.data)) throw 'No data';
let data = null;
// let data = cbor.decode(Buffer.from(json.data, 'base64'));
let data = cbor.decode(Buffer.from(json.data, 'base64'));
if (!Boolean(data) || !Boolean(data['poll'])) throw 'No data';

@@ -166,0 +164,0 @@ let poll = JSON.parse(data['poll']);

7

lib/state.js
'use strict'
const { getPollAddress, _hash } = require('./functions');
//const cbor = require('cbor');
const cbor = require('cbor');

@@ -32,4 +32,3 @@ class PollState {

try {
let data = null;
//let data = cbor.encode(ballots);
let data = cbor.encode(ballots);
let entries = {

@@ -123,3 +122,3 @@ [address]: data

if (!Boolean(data) || !Boolean(data[address]) || data[address].length == 0) return undefined;
//return cbor.decode(data[address]);
return cbor.decode(data[address]);
} catch(e) {

@@ -126,0 +125,0 @@ return undefined;

{
"name": "bitagora-booth",
"version": "1.0.25",
"version": "1.0.26",
"description": "Bitagora booth",

@@ -5,0 +5,0 @@ "main": "booth.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc