Skip to content

Instantly share code, notes, and snippets.

@NKid

NKid/utils.js Secret

Last active August 19, 2020 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NKid/06dd00806e27a9a0e54c to your computer and use it in GitHub Desktop.
Save NKid/06dd00806e27a9a0e54c to your computer and use it in GitHub Desktop.
[十進位/十六進位互轉] Hex and Decimal Convert
var numSys = {
d2h : function(d) {return d.toString(16);},
h2d : function(h) {return parseInt(h,16);}
}
numSys.d2h(255); //FF
numSys.h2d('FF'); //255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment