Skip to content

Instantly share code, notes, and snippets.

@nobusue
Created August 12, 2015 03:00
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 nobusue/2fa6be2feeb39ffcb886 to your computer and use it in GitHub Desktop.
Save nobusue/2fa6be2feeb39ffcb886 to your computer and use it in GitHub Desktop.
Groovyで16進->2進/10進変換
groovy -e "def b='10 49 4a 03'; println b.split(' ').collect{ Integer.decode('0x'+it) }.join(' '); println b.split(' ').collect{ Integer.toBinaryString(Integer.decode('0x'+it)).padLeft(8,'0') }.join('_')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment