]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blobdiff - prebuilt/iot-gateway/node_modules/signed-varint/node_modules/varint/encode.js
Updated Sensor To Cloud design to have an easy to use setup GUI on the
[apps/tidep0084.git] / prebuilt / iot-gateway / node_modules / signed-varint / node_modules / varint / encode.js
diff --git a/prebuilt/iot-gateway/node_modules/signed-varint/node_modules/varint/encode.js b/prebuilt/iot-gateway/node_modules/signed-varint/node_modules/varint/encode.js
deleted file mode 100644 (file)
index d395723..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-module.exports = encode
-
-var MSB = 0x80
-  , REST = 0x7F
-  , MSBALL = ~REST
-  , INT = Math.pow(2, 31)
-
-function encode(num, out, offset) {
-  out = out || []
-  offset = offset || 0
-  var oldOffset = offset
-
-  while(num >= INT) {
-    out[offset++] = (num & 0xFF) | MSB
-    num /= 128
-  }
-  while(num & MSBALL) {
-    out[offset++] = (num & 0xFF) | MSB
-    num >>>= 7
-  }
-  out[offset] = num | 0
-  
-  encode.bytes = offset - oldOffset + 1
-  
-  return out
-}