Skip to content

Instantly share code, notes, and snippets.

@morya
morya / gist:769ab6cc146f4ee1fc18e1e4eba5a45c
Created March 30, 2019 13:06 — forked from ik5/gist:65de721ca495fa1bf451
golang, convert UTF-16 to UTF-8 string
package main
import "fmt"
import "unicode/utf16"
import "unicode/utf8"
import "bytes"
func main() {
b := []byte{
@morya
morya / ecb.go
Created March 23, 2017 15:49 — forked from yinheli/ecb.go
golang 标准库不支持 AES/ECB/PKCS5Padding issues: https://code.google.com/p/go/issues/detail?id=5597 别人的补丁. https://codereview.appspot.com/7860047/
package main
import (
"crypto/cipher"
)
type ecb struct {
b cipher.Block
blockSize int
}