Skip to content

Instantly share code, notes, and snippets.

View vhain's full-sized avatar

Juwan Yoo vhain

View GitHub Profile
@vhain
vhain / long-encode.java
Last active September 25, 2018 08:10
int array to long encode/decode
import java.io.*;
import java.util.*;
class LongEncoder {
/**
* Returns long including all int[] values.
*
* @param values integer array to encode
* @param offset bit offset for each value. should meet criteria
* values.length * offset <= 64 which is maximum of long.

Keybase proof

I hereby claim:

  • I am vhain on github.
  • I am juwan (https://keybase.io/juwan) on keybase.
  • I have a public key ASB6jwQcmou4_oo2rC13UsECseWMxdKplqzAzHYxJIi6_Qo

To claim this, I am signing this object: