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 5package xz 6 7import "hash" 8 9type noneHash struct{} 10 11func (h noneHash) Write(p []byte) (n int, err error) { return len(p), nil } 12 13func (h noneHash) Sum(b []byte) []byte { return b } 14 15func (h noneHash) Reset() {} 16 17func (h noneHash) Size() int { return 0 } 18 19func (h noneHash) BlockSize() int { return 0 } 20 21func newNoneHash() hash.Hash { 22 return &noneHash{} 23} 24