Skip to content

Commit

Permalink
remove promise.prototype.finally and buffer-base62
Browse files Browse the repository at this point in the history
  • Loading branch information
ptweety committed Oct 11, 2022
1 parent e076902 commit c3ddd3a
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 98 deletions.
7 changes: 1 addition & 6 deletions nodes/ccu-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ const path = require('node:path');
const fs = require('node:fs');
const crypto = require('node:crypto');

const promiseFinally = require('promise.prototype.finally');

promiseFinally.shim();

const base62 = require('buffer-base62').toBase62;
const stringSimilarity = require('string-similarity');
const nextport = require('nextport');
const hmDiscover = require('hm-discover');
Expand Down Expand Up @@ -1482,7 +1477,7 @@ module.exports = function (RED) {
rpcInit(iface) {
return new Promise((resolve, reject) => {
const initUrl = this.rpcServer(iface);
const hash = base62(crypto.createHash('sha1').update(initUrl).digest()).slice(0, 6);
const hash = crypto.createHash('sha1').update(initUrl).digest('hex').slice(0, 6);
const initId = 'nr_' + hash + '_' + iface;
this.lastEvent[iface] = now();

Expand Down
Loading

0 comments on commit c3ddd3a

Please sign in to comment.