1
0
Fork 0
mirror of https://github.com/emojisum/emojisum.git synced 2025-07-28 11:00:26 +00:00
emojisum/cmd/emoji.go
Vincent Batts 548eaacf87 main: refactor a bit to get logic out of main and into ./cmd/
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2025-04-01 13:49:19 -04:00

21 lines
423 B
Go

package cmd
import (
esum "github.com/emojisum/emojisum/emoji"
)
// EmojiFromBytes parses the bytes buffer for colon notation and returns the
// corresponding emoji
func EmojiFromBytes(buf []byte) string {
var ret string
for _, b := range buf {
for _, e := range esum.Map(b) {
// use the first colon notation word and continue
if esum.IsColonNotation(e) {
ret = ret + e
break
}
}
}
return ret
}