// Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // The go-ethereum library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . // Package rle implements the run-length encoding used for Ethereum data. package rle import ( "bytes" "errors" "github.com/ethereum/go-ethereum/crypto" ) const ( token byte = 0xfe emptyShaToken = 0xfd emptyListShaToken = 0xfe tokenToken = 0xff ) var empty = crypto.Sha3([]byte("")) var emptyList = crypto.Sha3([]byte{0x80}) func Decompress(dat []byte) ([]byte, error) { buf := new(bytes.Buffer) for i := 0; i < len(dat); i++ { if dat[i] == token { if i+1 < len(dat) { switch dat[i+1] { case emptyShaToken: buf.Write(empty) case emptyListShaToken: buf.Write(emptyList) case tokenToken: buf.WriteByte(token) default: buf.Write(make([]byte, int(dat[i+1]-2))) } i++ } else { return nil, errors.New("error reading bytes. token encountered without proceeding bytes") } } else { buf.WriteByte(dat[i]) } } return buf.Bytes(), nil } func compressChunk(dat []byte) (ret []byte, n int) { switch { case dat[0] == token: return []byte{token, tokenToken}, 1 case len(dat) > 1 && dat[0] == 0x0 && dat[1] == 0x0: j := 0 for j <= 254 && j < len(dat) { if dat[j] != 0 { break } j++ } return []byte{token, byte(j + 2)}, j case len(dat) >= 32: if dat[0] == empty[0] && bytes.Compare(dat[:32], empty) == 0 { return []byte{token, emptyShaToken}, 32 } else if dat[0] == emptyList[0] && bytes.Compare(dat[:32], emptyList) == 0 { return []byte{token, emptyListShaToken}, 32 } fallthrough default: return dat[:1], 1 } } func Compress(dat []byte) []byte { buf := new(bytes.Buffer) i := 0 for i < len(dat) { b, n := compressChunk(dat[i:]) buf.Write(b) i += n } return buf.Bytes() } /npm_and_yarn/devel/electron4/files/minimist-1.2.3'>dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.3 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/german/kde4-l10n
Commit message (Expand)AuthorAgeFilesLines
* Rejoice, for the long awaited upgrade to kde 3.1.1 is here!alane2003-04-062-5/+2
* Clear moonlight beckons.ade2003-03-072-1/+1
* Upgrade kde-i18n to 3.1. Note that the following modules did not get awill2003-01-292-240/+725
* Fix categories to match dir containing port. bsd.port.mk (and portlint)alane2002-10-301-1/+2
* 1. Removed comments from pkg-plist files per will's request.alane2002-10-112-1/+2
* Update to 3.0.3. Not much changed here: [1] i18n PKGNAMEs converted towill2002-08-253-4/+42
* 1. Changed the lib depends on gettext to a build depends. This will meanalane2002-08-031-2/+2
* Bump PORTREVISION. KDE is fragile enough in its dependencies; we don'talane2002-08-021-0/+1
* Chase shlib rev of devel/gettextade2002-08-021-1/+1
* Fix MASTER_SITE_SUBDIR.will2002-07-101-1/+1
* Update to 3.0.2 -- full log available in ports/x11/kde3/Makefile,v 1.51.will2002-07-053-35/+16
* Upgrade to KDE 3.0.1. The delay in this upgrade is mainly due to thewill2002-06-163-43/+135
* Please welcome Qt3/KDE3 to our ports tree. This includes work since thewill2002-04-225-9/+1179