mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
27 lines
426 B
Go
27 lines
426 B
Go
package headsync
|
|
|
|
import "strings"
|
|
|
|
func concatStrings(strs []string) string {
|
|
var (
|
|
b strings.Builder
|
|
totalLen int
|
|
)
|
|
for _, s := range strs {
|
|
totalLen += len(s)
|
|
}
|
|
|
|
b.Grow(totalLen)
|
|
for _, s := range strs {
|
|
b.WriteString(s)
|
|
}
|
|
return b.String()
|
|
}
|
|
|
|
func splitString(str string) (res []string) {
|
|
const cidLen = 59
|
|
for i := 0; i < len(str); i += cidLen {
|
|
res = append(res, str[i:i+cidLen])
|
|
}
|
|
return
|
|
}
|