mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 11:45:25 +00:00
9 lines
187 B
Go
9 lines
187 B
Go
|
|
package tostring
|
||
|
|
|
||
|
|
import "unsafe"
|
||
|
|
|
||
|
|
// UnsafeToString converts byte slice to string with zero allocations
|
||
|
|
func UnsafeToString(bs []byte) string {
|
||
|
|
return *(*string)(unsafe.Pointer(&bs))
|
||
|
|
}
|