encode from long, encode from string