You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

none-check.go 519B

1234567891011121314151617181920212223
  1. // Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package xz
  5. import "hash"
  6. type noneHash struct{}
  7. func (h noneHash) Write(p []byte) (n int, err error) { return len(p), nil }
  8. func (h noneHash) Sum(b []byte) []byte { return b }
  9. func (h noneHash) Reset() {}
  10. func (h noneHash) Size() int { return 0 }
  11. func (h noneHash) BlockSize() int { return 0 }
  12. func newNoneHash() hash.Hash {
  13. return &noneHash{}
  14. }