Skip to content

Instantly share code, notes, and snippets.

View agore's full-sized avatar

Aditya Gore agore

View GitHub Profile

Keybase proof

I hereby claim:

  • I am agore on github.
  • I am aditya_gore (https://keybase.io/aditya_gore) on keybase.
  • I have a public key ASBjqQVBQlKnA5NEU9rDf0tR1s7d0dKyzTaPwf5vfxNVOgo

To claim this, I am signing this object:

@agore
agore / mm-min.js
Created September 15, 2016 18:55
Minimogrifier javascript function for sharing with TecAce for the Gear S2/S3 app
*
* @param image: fully qualified image path (required)
* @param width: desired width in pixels (optional, default = 360)
* @param height: desired width in pixels (optional, default = 360)
*
* v0.1 - initial implementation
*/
gannettResizer = function(image, width, height) { (function(G){function r(d,b,c){var h=0,a=[],g=0,f,m,k,e,l,p,q,t,w=!1,n=[],u=[],v,r=!1;c=c||{};f=c.encoding||"UTF8";v=c.numRounds||1;if(v!==parseInt(v,10)||1>v)throw Error("numRounds must a integer >= 1");if("SHA-1"===d)l=512,p=z,q=H,e=160,t=function(a){return a.slice()};else throw Error("Chosen SHA variant is not supported");k=A(b,f);m=x(d);this.setHMACKey=function(a,b,g){var c;if(!0===w)throw Error("HMAC key already set");if(!0===r)throw Error("Cannot set HMAC key after calling update");
f=(g||{}).encoding||"UTF8";b=A(b,f)(a);a=b.binLen;b=b.value;c=l>>>3;g=c/4-1;if(c<a/8){for(b=q(b,a,0,x(d),e);b.length<=g;)b.push(0);b[g]&=4294967040}else if(c>a/8){for(;b.length<=g;)b.push(0);b[g]&=4294967040}for(a=0;a<=g;a+=1)n[a]=b[a]^90952248

Keybase proof

I hereby claim:

  • I am agore on github.
  • I am aditya_gore (https://keybase.io/aditya_gore) on keybase.
  • I have a public key whose fingerprint is 46EE AA87 97C1 90EA 1EAF C4AD 2F90 8FFE ADF7 1D79

To claim this, I am signing this object: