From nobody Thu Jan 18 13:05:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG2zj0Yt8z58HQY; Thu, 18 Jan 2024 13:05:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TG2zj02Gwz4STR; Thu, 18 Jan 2024 13:05:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705583137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uH7reGf6rX+p/tmdxZv8rc3CHrEPzD0y6ncS+I/5cPU=; b=t6YpqqLJ08ECQ0gHHKM642ajx4mjZi9tWCzx7qLY/WXvoL0MnU3vtS0tBBlehR1CFp/nJd 4TSEdTxCzYY5YHj77R1DoTktDzAjpwsuW8NDh2eMS9zWWQRe96l5WkIyJz3HZuSUXBiWCv TaLIcAPQgi19o8ra2G96b/of0thbvJAuozHvvVImnl2Qd29OfF5fvO4ofe3DOiI86jbqht 1Pd7JzsUr4PTjgXPqEJzABRF0yenSgJOniFSEy4zgqwGOB87tF1a1r3INzXxhzV25kQt21 RuR23ywNra8qDQyAuLa6qeQCVIrkq2urEMyajEBofJXuizpOX8jH6ja+uO1W8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705583137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uH7reGf6rX+p/tmdxZv8rc3CHrEPzD0y6ncS+I/5cPU=; b=VOR39nfXOyjkrVQK6tiM6JjwS6d2ZBoXL8rWhAfpsqtw3YVUtLH3OPUsZgT+3yygLc+TDt Hvx/ncFulKHG+DQBvXSXBSS7yvMgqjiRdddMzPSoL7aBE/NopSQdgp0mD6mBJDBbvciAhp rvlO/x/j9LqVwv2urj38LV03/Wi+UaDhB50oZSTIEBCOJ7yKMVpgC+pbGLIL4iHrASoHyE AhxC2eb99KhayoCSNq8OwQ8AxLzFPaKibFjhpMNVFCenb4bha+YW+0Hhew/sTCAg+12nzZ 83Pb8X+EZLazi3y7hjqx0hCb6rq3WCJi0Drdx7otJlWaMH8HD2WBJlfQq5cFJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705583137; a=rsa-sha256; cv=none; b=gsmelX+plo5fNtyriPChCxuc5EBXPVe6hDuuCcNI0u1Hgz7f0szEhFV9BNgsrkfSZqtND9 qSBfP4bHMPRfGmh1bDOe8ehICXT88eFCoR0vTsl/8aEYPcRM/eg7wghkVLPvZLO/Xw7kod H4eNtGwwrbGWNJZvFSwlkGBje41EIwgVZrR8mbqaAcbMPg+vgxzhHnEeVG+aXtxvREmxZs sEioNwP78TSmpPWdwbi+xFw2o9/z/L+0Whr9aVQ7ekWExXG8wL9+p/uDRZCJjlFJ00WL7o n62zW/4dtTB2hshcE2O7AG7dXARuMFZxtVDen5LrblsArUr7M/qel7xJVihCtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG2zh65szz16wf; Thu, 18 Jan 2024 13:05:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ID5acb044338; Thu, 18 Jan 2024 13:05:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ID5aFi044335; Thu, 18 Jan 2024 13:05:36 GMT (envelope-from git) Date: Thu, 18 Jan 2024 13:05:36 GMT Message-Id: <202401181305.40ID5aFi044335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fernando =?utf-8?Q?Apestegu=C3=ADa?= Subject: git: 70445a806122 - main - cksum(1): Add EXAMPLES to manual page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70445a8061226ad46a7079ce8ad96e89ae45d6c5 Auto-Submitted: auto-generated The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/src/commit/?id=70445a8061226ad46a7079ce8ad96e89ae45d6c5 commit 70445a8061226ad46a7079ce8ad96e89ae45d6c5 Author: Fernando ApesteguĂ­a AuthorDate: 2023-09-08 12:27:59 +0000 Commit: Fernando ApesteguĂ­a CommitDate: 2024-01-18 13:04:25 +0000 cksum(1): Add EXAMPLES to manual page Approved by: bcr@ --- usr.bin/cksum/cksum.1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/usr.bin/cksum/cksum.1 b/usr.bin/cksum/cksum.1 index debd77de87ff..cd9b78c12306 100644 --- a/usr.bin/cksum/cksum.1 +++ b/usr.bin/cksum/cksum.1 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 28, 1995 +.Dd January 18, 2024 .Dt CKSUM 1 .Os .Sh NAME @@ -149,6 +149,20 @@ The bit sequence is complemented and the result is the CRC. .Ed .Sh EXIT STATUS .Ex -std cksum sum +.Sh EXAMPLES +Compute the checksum for all available algorithms. +Notice the difference in the size representation (in bytes for algorithm 1 and 2 +and in blocks for 3 and the default algorithm): +.Bd -literal -offset indent +$ echo "hello" | cksum +3015617425 6 +$ echo "hello" | cksum -o 1 +36979 1 +$ echo "hello" | cksum -o 2 +542 1 +$ echo "hello" | cksum -o 3 +909783072 6 +.Ed .Sh SEE ALSO .Xr md5 1 .Pp