Sha256: 4092726ed527ce8efd540ca34096dfa79dd8341903bdc434890509d2532ecfd7
Contents?: true
Size: 301 Bytes
Versions: 396
Compression:
Stored size: 301 Bytes
Contents
'use strict'; module.exports = Binary; function Binary(binary) { if (binary.match(/^[01]*$/)) { this.binary = parseInt(binary, 2); } else { this.binary = 0; } } Binary.prototype.toDecimal = function () { var out = Number(this.binary.toString(10)); return isNaN(out) ? 0 : out; };
Version data entries
396 entries across 396 versions & 1 rubygems