mirror of https://github.com/pkg/sftp.git
14 lines
352 B
Go
14 lines
352 B
Go
|
package sftp
|
||
|
|
||
|
func marshalUint32(b []byte, v uint32) []byte {
|
||
|
return append(b, byte(v>>24), byte(v>>16), byte(v>>8), byte(v))
|
||
|
}
|
||
|
|
||
|
func marshalUint64(b []byte, v uint64) []byte {
|
||
|
return marshalUint32(marshalUint32(b, uint32(v>>24)), uint32(v))
|
||
|
}
|
||
|
|
||
|
func marshalString(b []byte, v string) []byte {
|
||
|
return append(marshalUint32(b, uint32(len(v))), v...)
|
||
|
}
|