Skip to content

ginx-contribs/str2bytes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

str2bytes

str2bytes is a package support convert string to []byte, and convert []byte to string, both of them without memory copy.

install

ge get github.com/ginx-contribs/str2bytes@latest

usage

package main

import (
	"github.com/ginx-contribs/str2bytes"
	"log"
)

func main() {
	bytes := str2bytes.Str2Bytes("hello world")
	log.Println(bytes)
	str := str2bytes.Bytes2Str(bytes)
	log.Println(str)
}

About

convertion between string and bytes

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages