pure golang implement for some padding algorithms.